<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">

		<h2>Modifica pacchetto "<h:outputText value="#{packageBean.pack.name}" />":</h2>

		<h:form>
			<p:panelGrid columns="2">
				<f:facet name="header">  
		        	Seleziona voli ed elementi alternativi per il pacchetto
		    	</f:facet>
		    	
		    	<h:outputText value="Hotel alternativi:" />
		    	<p:selectManyCheckbox value="#{packageBean.pack.hotelIds}" layout="pageDirection">  
		            <f:selectItems value="#{packageBean.additionalHotels}" var="h" itemLabel="#{h.name}" itemValue="#{h.id}" />  
		        </p:selectManyCheckbox> 
		        
		        <h:outputText value="Escursioni alternative:" />
		        <p:selectManyCheckbox value="#{packageBean.pack.excursionIds}" layout="pageDirection">  
		            <f:selectItems value="#{packageBean.additionalExcursions}" var="e" itemLabel="#{e.name}" itemValue="#{e.id}" />  
		        </p:selectManyCheckbox>
		        
		        <h:outputText value="Voli di andata disponibili:" />
		        <p:selectManyCheckbox value="#{packageBean.pack.outwardFlightIds}" layout="pageDirection">  
		            <f:selectItems value="#{packageBean.departureFlights}" var="f" itemLabel="#{f.departureInfo}" itemValue="#{f.id}" />  
		        </p:selectManyCheckbox>
		        
		        <h:outputText value="Voli di ritorno disponibili:" />
		        <p:selectManyCheckbox value="#{packageBean.pack.inwardFlightIds}" layout="pageDirection">  
		            <f:selectItems value="#{packageBean.returningFlights}" var="f" itemLabel="#{f.departureInfo}" itemValue="#{f.id}" />  
		        </p:selectManyCheckbox>
		       
		    	
		    	<f:facet name="footer"> 
		    	
		    		<center>
		    			<p:button outcome="editPackageDefaults" value="Indietro" />
		    			<p:commandButton action="#{packageBean.updatePackage}" value="Modifica" />
		    		</center>
		    	
		    	</f:facet>
			
			</p:panelGrid>
			</h:form>
			<br />
			<p:messages showDetail="true" autoUpdate="true" closable="true" />

	</ui:define>
</ui:composition>
</html>